package cuit.epoch.pymjl.distribuitedlock.controller;


import cuit.epoch.pymjl.distribuitedlock.service.WarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author Pymjl
 * @since 2022-10-10
 */
@RestController
@RequestMapping("/warehouse")
public class WarehouseController {

    private final WarehouseService warehouseService;

    public WarehouseController(WarehouseService warehouseService) {
        this.warehouseService = warehouseService;
    }

    @GetMapping("/deduct")
    public String deduct() {
        warehouseService.deductInRedis();
        return "succeed";
    }

}
